<%@ page language="java" import="weaver.general.BaseBean" pageEncoding="UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%--获取单点登录中的token--%>
<%
    String applicationUuid = Util.null2String(request.getParameter("applicationUuid"));
    Cookie cookies[] = request.getCookies();
    BaseBean baseBean = new BaseBean();
    String ticketValue = "";
    if (cookies != null) {
        for (Cookie cookie : cookies) {
            baseBean.writeLog(">>>>>getToken>>>>>cookie.getName()=" + cookie.getName() + "cookie.getValue()=" + cookie.getValue());
            if ("ticketCookie".equals(cookie.getName())) {
                ticketValue = cookie.getValue();
            }
        }
    }

%>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>认证页面跳转中...</title>
    <meta charset="utf-8">
    <script src="jquery-1.11.0.min.js"></script>
</head>

<script type="text/javascript">

    let ticket = '<%=ticketValue%>';
    let uuid = '<%=applicationUuid%>';
    if (ticket.length===0) {
        alert("未获取到ticket，请重新登录！");
    }else if (uuid.length === 0) {
        alert("未获取到uuid，请检测配置！");
    }else {
        let tokenUrl = "http://geely-uc-sso-protocol-restful-sit.sgw.test.geely.svc//api/public/bff/v1.2/plugin_geely_user_center/sso/go_ticket_"+uuid+"?ticket="+ticket;
        window.open(tokenUrl, '_self');
    }

</script>
<body>
<div class="jumbotron bg" style="height: 712px">
    <div class="container">
        <div class="row">
            <div class="col-md-4 col-md-push-8 text-info">
                <h1>认证页面跳转中。。。</h1>
            </div>
        </div>
    </div>
</div>
</body>
</html>


